let fs = require("fs")
let path = require("path")
let spanman = require("../index.js")

// 深拷贝
let arr = [1, 2, 3, 44]
let bArr = spanman.deepCopy(arr)
console.log("bArr---->", bArr)

// 删除数组中的某项
let arr2 = [1, 2, 3, 44]
let arr3 = spanman.remove(arr2, 3)

console.log("arr2---->", arr2) // 删除之后的对象
console.log("arr3---->", arr3) // 被删除的项

let json_files = spanman.get_target_files(path.resolve(__dirname, "../"), [])
let json_files2 = spanman.get_target_files(path.resolve(__dirname, "../"), ["json"], "Asc")
console.log("json_files---->", json_files) // 
console.log("json_files2---->", json_files2) // 

// 指定路径 创建文件夹
spanman.make_path(path.resolve(__dirname, "./7777/ccc/qwe/123/asd"))

console.log("777-img base64->", spanman.img_2_base64("../1.png"))

// 批量 图片 转换 base64 文件
spanman.imgs_2_base64s("E:\\myCode\\0 myProject\\myspanman\\src\\png_o_path", "E:\\myCode\\0 myProject\\myspanman\\src\\png_target_path", ["jpg", "png"])

spanman.http_server()

console.log("当前时间是---->", spanman.getDate())
console.log("指定时间戳---->", spanman.getDate("", 12312333))
console.log("指定格式---->", spanman.getDate("YYYY年DD天MM月", 12312333))

console.log("去重--纯数组-->", spanman.unique([1, 2, 2, 3, 3, 3]))
console.log("去重--对象数组-->", spanman.unique([{ a: 1 }, { a: "1" }, {}], "a"))

console.log("数字-->", spanman.judge2Obj(1, 2))
console.log("数字-->", spanman.judge2Obj(1, 1))
console.log("字符串-->", spanman.judge2Obj("123", null))
console.log("字符串-->", spanman.judge2Obj("123", "123"))
console.log("对比两个对象-->", spanman.judge2Obj({ a: 1 }, { a: "1" }))
console.log("对比两个对象-->", spanman.judge2Obj({ a: 1 }, { a: 1 }))
console.log("对比两个数组-->", spanman.judge2Obj([1, 2], [1, 2]))
console.log("对比两个数组-->", spanman.judge2Obj([1, {}], [1, {}]))
console.log("对比两个数组-[1, {}], [1, \"\"]->", spanman.judge2Obj([1, {}], [1, ""]))
console.log("对比两个数组-->", spanman.judge2Obj([1, { a: 1 }], [1, { a: 1 }]))
console.log("对比两个数组-->", spanman.judge2Obj([1, 2], [1, ""]))
